<div class="bigtitle"><?=lang('advertisement_title')?> &gt; <?=lang('label_update')?></div>
<table class='tblcontent' cellspacing='0' cellpadding='0' border='0'>
	<tr>
		<td>
			<?=form_open_multipart(site_url('advertisement/update'),array('name'=>'frm','onsubmit'=>'return f_validate()'),array('hidden_status'=>'','hidden_id'=>$detail->id))?>		
			<table class='tblinputform' cellspacing='1' cellpadding='2' border='0' width='50%'>
				<tr>
					<th width='20%'><?=lang('advertisement_location')?></th>
					<td width='80%'>
						<select name='cbo_location'>
							<? for($i=1;$i<=count($location);$i++){ ?>
							<option value='<?=$location[$i]->id?>' <?=($detail->locationid==$location[$i]->id?'selected="selected"':'')?>><?=$location[$i]->name?></option>
							<? }?>
						</select>
					</td>
				</tr>
				<tr>
					<th><?=lang('advertisement_image')?></th>
					<td>
						<? if(!empty($detail->image)){ ?>
						<img src='<?=base_url().$this->config->item('advertisement_img_path').$detail->image?>' border='0' width='230px;' /><br/>
						<? } ?>
						<input type="file" name="txt_image" size="20"/>
					</td>
				</tr>
				<tr>
					<th><?=lang('advertisement_link')?></th>
					<td><input type='text' name='txt_link' style='width:300px;' maxlength='200' value="<?=htmlspecialchars($detail->link)?>"/></td>
				</tr>				
			</table>
			<div class='ctrlbtn'>
				<input type='button' name='btn_save' value='<?=lang('label_save')?>' onclick='return f_validate()'/>	
				<input type='button' name='btn_cancel' value='<?=lang('label_cancel')?>' onclick='window.location="<?=site_url('advertisement')?>";'/>
			</div>
			<?=form_close()?>
		</td>
	</tr>
</table>
<script type='text/javascript'>
	f_onload();
	function f_onload(){ document.frm.cbo_location.focus();}
	function f_validate(){
		form = document.frm;		
		form.submit();
	}
</script>